/// 将一种类型转换成另一种类型
/// 默认是通过json序列化和反序列化的方式转换，也可以制定转换方式(通过serde = **指定)
/// # Examples
/// ```
/// use axum_common::transform;
/// use serde::{Deserialize, Serialize};
///
/// #[derive(Debug, Serialize, Deserialize)]
/// struct Stu1 {
///     name: String,
///     age: u8
/// }
///
/// #[derive(Debug, Serialize, Deserialize)]
/// struct Stu2 {
///     name: Option<String>,
///     age: u8
/// }
///
/// let stu1 = Stu1{
///     name: "sjt".to_string(),
///     age: 18
/// };
///
/// let r: Stu2 = transform!(&stu1);
/// assert_eq!(r, Stu2{name: Some("sjt".to_string()), age: 18})
/// ```
/// 

#[macro_export]
macro_rules! transform {
    (
        $source:expr
    )=> {
       {
           {
               use axum_common::ApiError;
               use axum_common::util::transform_json;
               transform_json($source)
           }
       }
    };
    // (
    //     $source:expr, serde = json
    // )=> {
    //    {
    //        $crate::transform!($source)
    //    }
    // };
}
